%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/interfaces-via-union-all/vulnerabilitiesConnection.before1"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 11, 12, 14, 27, 55, 56, 13, 16<br />2: PgUnionAll[10]<br />ᐳ: Access[22]<br />3: Connection[15]<br />4: ConnectionItems[17]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 15, 22, 27, 17, 13<br /><br />ROOT Connectionᐸ10ᐳ[15]"):::bucket
    Bucket3("Bucket 3 (listItem)<br />Deps: 22, 27, 13<br /><br />ROOT __Item{3}ᐸ17ᐳ[20]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 29, 21, 13, 31, 23<br /><br />ROOT Edge{3}[21]"):::bucket
    Bucket5("Bucket 5 (polymorphic)<br />__typename: Access[30]<br />Deps: 30, 13, 31"):::bucket
    Bucket6("Bucket 6 (polymorphicPartition)<br />|FirstPartyVulnerability<br />Deps: 13, 31<br />ᐳFirstPartyVulnerability<br /><br />1: PgSelect[32]<br />2: PgSelectRows[37]<br />ᐳ: 36, 38, 47, 49, 51, 53"):::bucket
    Bucket7("Bucket 7 (polymorphicPartition)<br />|ThirdPartyVulnerability<br />Deps: 13, 31<br />ᐳThirdPartyVulnerability<br /><br />1: PgSelect[40]<br />2: PgSelectRows[45]<br />ᐳ: 44, 46, 48, 50, 52, 54"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket5
    Bucket5 --> Bucket6 & Bucket7

    %% plan dependencies
    PgUnionAll10[["PgUnionAll[10∈0] ➊<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[13]<br />- Constantᐸ[Function: applyInputConstant]ᐳ[14]<br />- Constantᐸ2ᐳ[55]"]]:::plan
    Lambda16{{"Lambda[16∈0] ➊<br />ᐸparseCursorᐳ<br />More deps:<br />- Constantᐸ'WyJkMTg1OWM4N2RhIiwiNy4yIiwiVGhpcmRQYXJ0eVZ1bG5lcmFiaWxpdHkᐳ[56]"}}:::plan
    Lambda16 --> PgUnionAll10
    Connection15[["Connection[15∈0] ➊<br />ᐸ10ᐳ<br />More deps:<br />- Constantᐸ2ᐳ[55]"]]:::plan
    PgUnionAll10 & Lambda16 --> Connection15
    Object13{{"Object[13∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 3"}}:::plan
    Access11{{"Access[11∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access12{{"Access[12∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access11 & Access12 --> Object13
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access11
    __Value2 --> Access12
    ConnectionItems17[["ConnectionItems[17∈0] ➊"]]:::plan
    Connection15 --> ConnectionItems17
    Access22{{"Access[22∈0] ➊<br />ᐸ10.cursorDetailsᐳ"}}:::plan
    PgUnionAll10 --> Access22
    List28{{"List[28∈3]<br />ᐸ25,26,27ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[27]"}}:::plan
    Access25{{"Access[25∈3]<br />ᐸ20.0ᐳ"}}:::plan
    Access26{{"Access[26∈3]<br />ᐸ20.1ᐳ"}}:::plan
    Access25 & Access26 --> List28
    Edge21{{"Edge[21∈3]"}}:::plan
    __Item20[/"__Item[20∈3]<br />ᐸ17ᐳ"\]:::itemplan
    PgCursor23{{"PgCursor[23∈3]"}}:::plan
    __Item20 & PgCursor23 --> Edge21
    __Item20 & Access22 --> PgCursor23
    ConnectionItems17 ==> __Item20
    __Item20 --> Access25
    __Item20 --> Access26
    Lambda29{{"Lambda[29∈3]<br />ᐸtoSpecifierᐳ"}}:::plan
    List28 --> Lambda29
    Access31{{"Access[31∈3]<br />ᐸ29.idᐳ"}}:::plan
    Lambda29 --> Access31
    Access30{{"Access[30∈4]<br />ᐸ29.__typenameᐳ"}}:::plan
    Lambda29 --> Access30
    PgSelect32[["PgSelect[32∈6]<br />ᐸfirst_party_vulnerabilitiesᐳ<br />ᐳFirstPartyVulnerability<br />More deps:<br />- Object[13]"]]:::plan
    Access31 --> PgSelect32
    First36{{"First[36∈6]^"}}:::plan
    PgSelectRows37[["PgSelectRows[37∈6]^"]]:::plan
    PgSelectRows37 --> First36
    PgSelect32 --> PgSelectRows37
    PgSelectSingle38{{"PgSelectSingle[38∈6]^<br />ᐸfirst_party_vulnerabilitiesᐳ"}}:::plan
    First36 --> PgSelectSingle38
    PgClassExpression47{{"PgClassExpression[47∈6]^<br />ᐸ__first_pa...vss_score”ᐳ"}}:::plan
    PgSelectSingle38 --> PgClassExpression47
    PgClassExpression49{{"PgClassExpression[49∈6]^<br />ᐸ__first_pa...ies__.”id”ᐳ"}}:::plan
    PgClassExpression47 o--o PgClassExpression49
    PgClassExpression51{{"PgClassExpression[51∈6]^<br />ᐸ__first_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression49 o--o PgClassExpression51
    PgClassExpression53{{"PgClassExpression[53∈6]^<br />ᐸ__first_pa...team_name”ᐳ"}}:::plan
    PgClassExpression51 o--o PgClassExpression53
    PgSelect40[["PgSelect[40∈7]<br />ᐸthird_party_vulnerabilitiesᐳ<br />ᐳThirdPartyVulnerability<br />More deps:<br />- Object[13]"]]:::plan
    Access31 --> PgSelect40
    First44{{"First[44∈7]^"}}:::plan
    PgSelectRows45[["PgSelectRows[45∈7]^"]]:::plan
    PgSelectRows45 --> First44
    PgSelect40 --> PgSelectRows45
    PgSelectSingle46{{"PgSelectSingle[46∈7]^<br />ᐸthird_party_vulnerabilitiesᐳ"}}:::plan
    First44 --> PgSelectSingle46
    PgClassExpression48{{"PgClassExpression[48∈7]^<br />ᐸ__third_pa...vss_score”ᐳ"}}:::plan
    PgSelectSingle46 --> PgClassExpression48
    PgClassExpression50{{"PgClassExpression[50∈7]^<br />ᐸ__third_pa...ies__.”id”ᐳ"}}:::plan
    PgClassExpression48 o--o PgClassExpression50
    PgClassExpression52{{"PgClassExpression[52∈7]^<br />ᐸ__third_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression50 o--o PgClassExpression52
    PgClassExpression54{{"PgClassExpression[54∈7]^<br />ᐸ__third_pa...ndor_name”ᐳ"}}:::plan
    PgClassExpression52 o--o PgClassExpression54

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgUnionAll10,Access11,Access12,Object13,Connection15,Lambda16,ConnectionItems17,Access22 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item20,Edge21,PgCursor23,Access25,Access26,List28,Lambda29,Access31 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,Access30 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgSelect32,First36,PgSelectRows37,PgSelectSingle38,PgClassExpression47,PgClassExpression49,PgClassExpression51,PgClassExpression53 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgSelect40,First44,PgSelectRows45,PgSelectSingle46,PgClassExpression48,PgClassExpression50,PgClassExpression52,PgClassExpression54 bucket7

